/*
 * JanelaSobre.java
 *
 * Created on 6 de Fevereiro de 2008, 02:03
 */
package org.jsshbroadcast.ui.gui;

import org.jsshbroadcast.util.*;
import java.awt.Cursor;
import java.util.*;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author  Eduardo
 */
public class JanelaSobre extends javax.swing.JDialog {

    /** Creates new form JanelaSobre */
    public JanelaSobre(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();

        LabelLinkProjeto.setCursor(new Cursor(Cursor.HAND_CURSOR));

        Vector linhas = new Vector();
        Vector colunas = new Vector();
        colunas.addElement("Propriedade");
        colunas.addElement("Valor");
        Properties teste = System.getProperties();
        for (Enumeration e = teste.propertyNames(); e.hasMoreElements();) {
            String propri = e.nextElement().toString();
            Vector lin = new Vector();
            lin.addElement(propri);
            lin.addElement(System.getProperty(propri));
            linhas.addElement(lin);
        }
        TabelaPropriedades.setModel(new DefaultTableModel(linhas, colunas));
        TabelaPropriedades.setEnabled(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BotaoFechar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        TabelaPropriedades = new javax.swing.JTable();
        LabelLinkProjeto = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("JSSHBroadcast");
        setResizable(false);

        BotaoFechar.setText("Fechar");
        BotaoFechar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotaoFecharActionPerformed(evt);
            }
        });

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/jsshbroadcast/images/chardevice.png"))); // NOI18N

        jLabel2.setFont(new java.awt.Font("Arial", 1, 36));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("JSSHBroadcast");

        jLabel3.setFont(new java.awt.Font("Arial", 0, 18));
        jLabel3.setForeground(jLabel2.getForeground());
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("Versão 0.0.2e");

        jLabel4.setFont(new java.awt.Font("Arial", 2, 14));
        jLabel4.setForeground(jLabel2.getForeground());
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("Desenvolvido por Eduardo Folly");

        TabelaPropriedades.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Title 1", "Title 2"
            }
        ));
        TabelaPropriedades.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
        TabelaPropriedades.setCellSelectionEnabled(true);
        TabelaPropriedades.setEditingColumn(0);
        TabelaPropriedades.setEditingRow(0);
        jScrollPane1.setViewportView(TabelaPropriedades);

        LabelLinkProjeto.setText("<html><a href=\"#\">Visite a página do projeto</a></html>");
        LabelLinkProjeto.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                LabelLinkProjetoMouseClicked(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 565, Short.MAX_VALUE)
                    .add(layout.createSequentialGroup()
                        .add(jLabel1)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)
                            .add(jLabel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 429, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 429, Short.MAX_VALUE)))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .add(LabelLinkProjeto)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 319, Short.MAX_VALUE)
                        .add(BotaoFechar)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel1)
                    .add(layout.createSequentialGroup()
                        .add(jLabel2)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabel3)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabel4)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
                .add(11, 11, 11)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(BotaoFechar)
                    .add(LabelLinkProjeto))
                .addContainerGap())
        );

        pack();
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        java.awt.Dimension dialogSize = getSize();
        setLocation((screenSize.width-dialogSize.width)/2,(screenSize.height-dialogSize.height)/2);
    }// </editor-fold>//GEN-END:initComponents
    private void BotaoFecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotaoFecharActionPerformed
        this.dispose();
    }//GEN-LAST:event_BotaoFecharActionPerformed

    private void LabelLinkProjetoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_LabelLinkProjetoMouseClicked
        BareBonesBrowserLaunch.openURL("http://www.efolly.com.br/jsshbroadcast/");
    }//GEN-LAST:event_LabelLinkProjetoMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotaoFechar;
    private javax.swing.JLabel LabelLinkProjeto;
    private javax.swing.JTable TabelaPropriedades;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
